package com.kehutong.admin.controler;

import org.coraframework.authz.HasPermission;
import org.coraframework.inject.Inject;
import org.coraframework.json.JSONObject;
import org.coraframework.mvc.MvcAction;
import org.coraframework.mvc.http.ReqMapping;
import org.coraframework.orm.jdbc.JdbcSession;

import com.kehutong.admin.entity.Log;
import com.kehutong.common.util.Token;

@MvcAction
@ReqMapping("/admin/sys/log")
public class LogController {

	 @Inject
    private JdbcSession jdbcSession;

    @HasPermission("sys:log:view")
    @ReqMapping("/list")
    public Object list(Token token, JSONObject  jsonObject) {
    	return jdbcSession.findPage(Log.class)
	    		.eq(jsonObject, "type", "companyNo")
	    		.like(jsonObject, "request_uri")
	    		.between("createTime", jsonObject, "beginTime", "endTime")
    			.order("createTIme", "desc")
    			.page(jsonObject)
    			.exe();
    }
    
}
